home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / sysdeps / mach / hurd / Makefile < prev    next >
Makefile  |  1994-05-30  |  4KB  |  111 lines

  1. # Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3.  
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Library General Public License
  6. # as published by the Free Software Foundation; either version 2 of
  7. # the License, or (at your option) any later version.
  8.  
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. # Library General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU Library General Public
  15. # License along with the GNU C Library; see the file COPYING.LIB.  If
  16. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. # Cambridge, MA 02139, USA.
  18.  
  19. # Get mach-srcdir defined.
  20. old-in-Makerules := $(in-Makerules)
  21. in-Makerules :=
  22. include $(..)sysdeps/mach/Makefile
  23. in-Makerules := $(old-in-Makerules)
  24.  
  25.  
  26. ifndef hurd-srcdir-computed
  27. hurd-srcdir-computed := yes
  28.  
  29. # If we were configured with `--with-hurd=DIR', then config.make sets
  30. # hurd-srcdir to DIR.  Otherwise guess we are in a big source tree.
  31. ifndef hurd-srcdir
  32. hurd-srcdir = ../hurd
  33. endif
  34.  
  35. # hurd-srcdir is now set to the logical directory name.  This name might be
  36. # relative to $(objdir), might be relative to the source directory $(..), or
  37. # might be absolute.  We choose among these possibilities by looking for a
  38. # canonical file in each of those places (in that order).
  39. f := hurd/hurd_types.defs # Random file that identifies the Hurd source dir.
  40. f := $(strip $f)
  41. hurd-srcdir := $(firstword $(patsubst %/$f,%,$(wildcard $(addsuffix /$f,\
  42.            $(objpfx)$(hurd-srcdir) $(..)$(hurd-srcdir)))) $(hurd-srcdir))
  43.  
  44. endif    # ! hurd-srcdir-computed
  45.  
  46. ifdef in-Makerules
  47.  
  48. # For the time being, elide directories where nothing at all works.
  49. subdirs := $(filter-out inet sunrpc manual,$(subdirs)) # XXX
  50.  
  51. # Look for header files in hurd/ under the top-level library source directory.
  52. includes += -I$(..)hurd
  53.  
  54. # When compiling, use the Hurd header files directly from the sources.
  55. includes += -I$(hurd-srcdir) -I$(hurd-srcdir)/libthreads
  56.  
  57. # Find the Hurd header files in the Hurd source.
  58. vpath hurd/%.h $(hurd-srcdir)
  59.  
  60. # Do not use any assembly code from sysdeps/unix (and subdirectories).
  61. # This bypasses all the system call stubs and uses any existing posix or
  62. # generic C files instead.
  63. inhibit-sysdep-asm += unix*
  64.  
  65. # Don't try to generate anything from the installed Unix system and its
  66. # libraries.  That is only of use when building for a Unix system, so as to
  67. # be compatible with some existing binaries for that system.
  68. inhibit-glue = yes
  69.  
  70.  
  71. ifeq (,$(filter mach hurd,$(subdir)))
  72. # Subdirectories other than hurd/ might use the generated Hurd headers.
  73. # So make sure we get a chance to run in hurd/ to make them before all else.
  74. # (But we don't want to do this in mach/, because hurd/ needs some things
  75. # there, and we know mach/ doesn't need anything from hurd/.)
  76.  
  77. ifdef objpfx
  78. hurd-objpfx = $(objpfx)
  79. else
  80. hurd-objpfx = $(..)hurd/
  81. endif
  82.  
  83. # These are all the generated headers that <hurd.h> includes.
  84. before-compile += $(patsubst %,$(hurd-objpfx)hurd/%.h,io fs process)
  85. $(patsubst %,$(hurd-objpfx)hurd/%.%,io fs process):
  86.     $(MAKE) -C $(..)hurd generated no_deps=t
  87. endif
  88.  
  89. # Generate errnos.h and sys_errlist.c from the section of the manual that
  90. # lists all the errno codes.
  91.  
  92. errno.texinfo = $(..)manual/errno.texi
  93.  
  94. hurd = $(..)sysdeps/mach/hurd
  95.  
  96. $(hurd)/errnos.h: $(objpfx)stamp-errnos ;
  97. $(objpfx)stamp-errnos: $(hurd)/errnos.awk $(errno.texinfo) \
  98.                $(mach-srcdir)/mach/message.h \
  99.                $(mach-srcdir)/mach/kern_return.h \
  100.                $(mach-srcdir)/mach/mig_errors.h \
  101.                $(mach-srcdir)/device/device_types.h
  102.     gawk -f $^ > $(hurd)/errnos.h-tmp
  103.     ./$(..)move-if-change $(hurd)/errnos.h-tmp $(hurd)/errnos.h
  104.     touch $@
  105.  
  106. $(hurd)/errlist.c: $(hurd)/errlist.awk $(errno.texinfo)
  107.     gawk -f $^ > $@-tmp
  108.     mv $@-tmp $@
  109.  
  110. endif    # in-Makerules
  111.